package cn.xiaohuodui.form.good;

import cn.xiaohuodui.form.PageForm;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by TR on 2018/4/2.
 */
@Data
public class SearchForm{


    private Integer categoryId;

    private Integer category2Id;

    private Integer brandId;

    private String keyword;

    private Integer userId;

    private Integer isNew;

    private Integer isHot;

    private Integer page=1;

    private Integer size=10;

    //筛选项
    private String sort;

    //asc or desc
    private String order;

    private String sortWithOrder;

    public Map toMap(){
        Map map = new HashMap();
        map.put("categoryId",this.categoryId);
        map.put("category2Id",this.category2Id);
        map.put("brandId",this.brandId);
        map.put("keyword",this.keyword);
        map.put("isNew",this.isNew);
        map.put("isHot",this.isHot);
        map.put("sortWithOrder",this.sortWithOrder);
        map.put("offset",(this.page-1)*this.size);
        map.put("limit",this.size);
        return map;}
}
